<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>layui</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="./layui/css/layui.css">
</head>
<body>
<div id="app">

    <table class="layui-table" lay-data="{height: 313, data:[{id:2,username:'张三',score:20,wealth:'6666'}], initSort: {field:'wealth', type:'desc'}}" lay-filter="demoEvent">
        <thead>
            <tr>
                <th lay-data="{field:'id', width:80}">ID</th>
                <th lay-data="{field:'username', width:80}">用户名</th>
                <th lay-data="{field:'score', width:80, sort: true}">评分</th>
                <th lay-data="{field:'wealth', sort: true, minWidth: 150}">财富</th>
            </tr>
        </thead>
    </table> 
</div>

<script src="./layui/layui.js"></script>
<script src="./js/vue.min.js"></script>
<script>
var App = new Vue({
    el: '#app',
    data: {
        list:[],
    },
    mounted: function() {
        this.getMakerList();
    },
    methods: {
        getMakerList: function(e) {
            let that = this;
            that.options = [
                {label: '写作',value: 1},
                {label: '阅读',value: 2},
                {label: '听歌',value: 3},
                {label: '游戏',value: 4},
            ];
            that.$nextTick(function() {
                layui.use('table',function(){
                    var table = layui.table;
                })
            });
        },
    }
});
// layui.use('table', function(){
// var table = layui.table; 
// });
</script>

</body>
</html>